<div class="table-responsive">
  <table class="table table-striped">
    <thead>
    <tr>
      <th>序号</th>
      <th>姓名</th>
      <th>性别</th>
      <th>报名时间</th>
      <th>省</th>
      <th>市</th>
      <th>公司</th>
      <th>手机号码</th>
      <th>标签</th>
      <th class="text-center">照片</th>
      <th class="text-center">头像</th>
      <th>管理</th>
    </tr>
    </thead>
    <tbody>
    <% @attendees.each do |attendee| %>
      <tr>
        <td><%=attendee.attendee_number%></td>
        <td><%=attendee.name%></td>
        <td><%=attendee.gender%></td>
        <td><%=attendee.created_at%></td>
        <td><%=attendee.province%></td>
        <td><%=attendee.city%></td>
        <td><%=attendee.company%></td>
        <td><%=attendee.mobile%></td>
        <td><%=attendee.category.try(:name)%></td>
        <td class="text-center">
          <% if attendee.photo.exists? %>
            <%= link_to attendee.photo.url, target: '_blank' do%> <i class="fa fa-picture-o text-success"></i> <% end %>
          <% end %>
        </td>
        <td class="text-center">
          <% if attendee.avatar.exists? %>
            <%= link_to attendee.avatar.url, target: '_blank', class:'btn btn-normal btn-xs' do%>
              <i class="fa fa-smile-o text-success"></i>
            <% end %>
          <% elsif attendee.photo.exists? %>
            <%= link_to avatar_event_attendee_path(current_event, attendee, back_url: request.original_url ), class:'btn btn-xs btn-outline btn-normal' do %>
              <i class="fa fa-frown-o text-danger"></i>
            <% end %>
          <% end %>
        </td>
        <td>
          <%=link_to '查看', event_attendee_path(current_event, attendee), class: 'btn btn-white btn-xs' %>
          <%=link_to '编辑', edit_event_attendee_path(current_event, attendee), class: 'btn btn-white btn-xs' %>
        </td>
      </tr>
    <% end %>
    </tbody>
  </table>

</div>

<div class="row">
  <div class="col-sm-12">
    <%= paginate @attendees %>
  </div>
</div>